package chpt02;

public class ExplicitTypeConvert {

	public static void main(String[] args) {
		System.out.println("8/3=" + 8 / 3); // 未强制类型转换
		System.out.println("强制类型转换下的8/3=" + (double) 8 / 3);
		// 对如上类型转换，通常使用隐式类型转换 8*1.0/3

		double a = -30.3;
		int a1 = (int) a;   // double强制转换为int型

		long b = 987L, c = 'A' + 25L;
		int b1 = (int) b;   // long强制转换为int
		char c1 = (char) c; // long强制转换为char

		System.out.println(a1 + " " + b1 + " " + c1);
	}
}
